package functionalTest;

import javax.jms.JMSException;
import javax.naming.NamingException;

import messagebeans.PublisherBean;

import org.junit.Test;

public class PublisherBeanTest {

	@Test
	public void testPubSubMessage() throws JMSException, NamingException {
		PublisherBean publisherBean = PublisherBean.newPublisherBean();
		String scheduleMessageInXml = 
			"<schedule id=\"89223\" created=\"2011-04-01\">" +
					"<pos order=\"1\" id=\"THSB1\">" +
						"<name>Tung-Hua-Seng Banglumpoo</name>" +
						"<reach>11:00</reach>" +
					"</pos>" +
					"<pos order=\"2\" id=\"THST1\">" +
						"<name>Tung-Hua-Seng Thonburi</name>" +
						"<reach>11:30</reach>" +
					"</pos>" +
					"<pos order=\"3\" id=\"THSB1\">" +
						"<name>GL Pinklao</name>" +
						"<reach>13:00</reach>" +
					"</pos>" +
					"<pos order=\"4\" id=\"MB1\">" +
						"<name>The Mall Bangkae</name>" +
						"<reach>14:00</reach>" +
					"</pos>" +
				"</schedule>";
		publisherBean.notify(scheduleMessageInXml);
		publisherBean.release();
	}
}
